package com.demo.salary.payrolldomain;

import com.demo.salary.PayCheck;
import com.demo.salary.Util;

import java.time.LocalDate;

public abstract class PaymentClassification {
    abstract double calculatePay(PayCheck pc);

    boolean isInPayPeriod(LocalDate theDate, PayCheck payCheck) {
        LocalDate payPeriodStartDate = payCheck.getPayPeriodStartDate();
        LocalDate itsPayDate = payCheck.getItsPayDate();
        return Util.inPeriod(theDate, payPeriodStartDate, itsPayDate);
    }
}
